<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>08条件判断渲染</title>
    <style>
        .redBorder{
            border-color: red;
            border-width: 1px;
            border-style: solid;
        }
    </style>
</head>
<body>
<div id="app">
    计算器：{{ counter }}<br>
    <!--v-if隐藏时会直接销毁节点-->
    <div v-if="flag">显示=true</div>
    <div v-else>显示=false</div>v-show=
    <div v-if="type=='A'">type=='A'</div>
    <div v-else-if="type=='B'">type=='B'</div>
    <div v-else>type为其他值</div>
    <template v-if="true">
        <h2>二级标题</h2>
        <h3>三级标题</h3>
        <div>内容</div>
    </template>
    <!--v-show隐藏是利用display:none实现的-->
    <!--v-show不支持else和template-->
    <div v-show="flag" class="redBorder">
        <h2>二级标题</h2>
        <h3>三级标题</h3>
        <div>内容</div>
    </div>
</div>
<script src="../vue.global.3.0.5.js"></script>
<script>
    //声明一个选项对象
    const App={
        //初始数据
        data() {
            return {
                counter: 100,
                flag: true,
                type: "A"
            }
        },
        methods: {
            
        },
        computed: {
            compClassName: {
                get() {
                    
                },
                set(value) {

                }
            }
        }
    }

    //全局API对象，创建应用对象返回(选项对象).挂载方法(DOM节点)
    const vm = Vue.createApp(App).mount("#app");
</script>
</body>
</html>